package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Search;
import cn.wolfcode.trip.base.mapper.SearchMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import cn.wolfcode.trip.base.service.ISearchService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SearchServiceImpl implements ISearchService {

    @Autowired
    private SearchMapper searchMapper;



    @Override
    public PageInfo query(SearchQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<Search> list= searchMapper.selectForList(qo);

        return new PageInfo(list);
    }

    @Override
    public PageInfo query2(SearchQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());

        List<Search> list2= searchMapper.selectForList2(qo);
        return new PageInfo(list2);
    }



}
